package com.zx.flow.core.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zx.flow.api.config.FlowConfig;
import com.zx.flow.api.execute.model.FlowContext;
import com.zx.flow.api.execute.model.FlowNode;
import com.zx.flow.api.execute.request.FlowParam;
import com.zx.flow.api.execute.request.manager.ManagerFlowConfigListForm;
import com.zx.flow.api.execute.request.manager.ManagerFlowListForm;
import com.zx.flow.api.execute.response.Response;
import java.util.List;

public interface FlowService {

    /**
     * 查询流程列表
     *
     * @return
     */
    Response<IPage<FlowContext>> getFlowList(ManagerFlowListForm form);

    /**
     * 查询流程配置列表
     *
     * @return
     */
    Response<IPage<FlowConfig>> getFlowConfigList(ManagerFlowConfigListForm form);

    /**
     * 保存流程配置
     *
     * @param flowConfig
     */
    Response<FlowConfig> saveFlowConfig(FlowConfig flowConfig);

    /**
     * 执行流程
     *
     * @param param
     * @return
     */
    Response<FlowContext> execute(FlowParam param);

    /**
     * 查询单个流程
     *
     * @param flowId
     * @return
     */
    Response<FlowContext> getFlow(String flowId);

    /**
     * 查询流程单个节点
     *
     * @param flowId
     * @param nodeId
     * @return
     */
    Response<FlowNode> getNode(String flowId, String nodeId);

    /**
     * 查询所有的流程节点
     *
     * @param flowId
     * @return
     */
    Response<List<FlowNode>> getNodes(String flowId);


}
